<?php

namespace app\admin\model;

use think\Model;


class Seller extends Model
{

    

    

    // 表名
    protected $name = 'seller';
    
    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'create_time';
    protected $updateTime = false;
    protected $deleteTime = false;
     // 追加属性
    protected $append = [
        'state_text'
    ];
    
    
    public function getStateList()
    {
        return  ['normal' => __('Normal'), 'hidden' => __('Hidden')];
    }


    public function getStateTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['state']) ? $data['state'] : '');
        $list = $this->getStateList();
        return isset($list[$value]) ? $list[$value] : '';
    }


}
